Klasse PdfSource

java.lang.Object
com.inet.pdfc.config.PdfSource
Alle implementierten Schnittstellen:
Serializable, Comparable<PdfSource>
Bekannte direkte Unterklassen:
ArrayPdfSource, FilePdfSource

@JsonData public abstract class PdfSource extends Object implements Comparable<PdfSource>, Serializable
This is an abstraction for raw PDF documents. It provides access to the raw content of the document as well as the most basic meta data.
Seit:
3.0
Siehe auch:
  • Felddetails

  • Konstruktordetails

    • PdfSource

      @Deprecated public PdfSource()
      Veraltet.
      As of i-net PDFC 23.10 - use the protected constructor PdfSource(String, String, long, long) instead
      Creates an empty document with no name, no path, a size of 0 bytes and a last modified of 1st of January 1970.
      Seit:
      3.0
    • PdfSource

      protected PdfSource(String name, String path, long lastModified, long size)
      Creates the document source instance
      Parameter:
      name - the name of the document (usually the file name, not the title set in the meta data of the document)
      path - the path of the document
      lastModified - the last modified time stamp
      size - the size in bytes
      Seit:
      23.10
  • Methodendetails

    • setLanguage

      public void setLanguage(String language)
      Set the language for this document
      Parameter:
      language - the language for this document
      Seit:
      5.0
    • getLanguage

      public String getLanguage()
      Return the language for this document
      Gibt zurück:
      the language for this document
      Seit:
      5.0
    • setPageLimit

      public void setPageLimit(int pageLimited)
      Set the maximal number of pages the document source will return
      Parameter:
      pageLimited - the maximum number of pages to read, if >=0, there will be no limit
      Seit:
      4.0
    • getName

      public @Nonnull String getName()
      Returns the name of the PDF document. This may be the original file name for instance of the name provided in the meta data of the document. It will be used to reference the document in reports or log output.
      Gibt zurück:
      the name of the document, never null
      Seit:
      3.0
    • getPath

      public String getPath()
      Get the path of this document, if one exist. If no existing path, it give null back.
      Gibt zurück:
      return the path of the document or null if no path exist
      Seit:
      4.0
    • getLastModified

      public long getLastModified()
      Returns the time of the last modification to the document. It's only used for report generation an has no impact on the comparison.
      Gibt zurück:
      the last modified timestamp of the document; interpreted as milliseconds since the beginning of 1970
      Seit:
      3.0
    • getSize

      public long getSize()
      Returns the size of the raw data in bytes
      Gibt zurück:
      the size of the raw data in bytes
      Seit:
      3.0
    • getContent

      public abstract com.inet.persistence.RandomAccessRead getContent() throws IOException
      Returns the readable content of this document source
      Gibt zurück:
      the readable content of this document source
      Löst aus:
      IOException - thrown in case the source data cannot be accessed or does not exist
      Seit:
      21.10
    • getPassword

      public String getPassword()
      Returns the user password to decode the PDF source
      Gibt zurück:
      the user password, may be null for none
      Seit:
      3.0
    • setPassword

      public void setPassword(String password)
      Sets the user password to decode the PDF source
      Parameter:
      password - the user password, may be null for none
      Seit:
      3.0
    • getMetaProperties

      protected Map<String,String> getMetaProperties()
      Returns the meta properties map to store any additional information to. Please consider using this map instead of instance fields for additional information.
      Gibt zurück:
      the meta properties, not null
      Seit:
      4.0
    • compareTo

      public int compareTo(@Nonnull PdfSource o)
      Angegeben von:
      compareTo in Schnittstelle Comparable<PdfSource>
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object